docs: add Android deprecated API removals to Capacitor 9 upgrade guide - #581
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ted-apis' into chore/RMET-5304-cap9-android-deprecated-apis # Conflicts: # docs/main/updating/9-0.md # sidebars.js
| Capacitor 9 also removes the Java APIs that were deprecated in previous major versions. If your app or plugin still uses any of them, replace them as follows. | ||
|
|
||
| | Removed | Replacement | | ||
| | :------ | :---------- | | ||
| | `CapConfig(AssetManager, JSONObject)` constructor | `CapConfig.loadDefault(Context)` to load from `capacitor.config.json`, or `CapConfig.Builder` for embedded use | | ||
| | `CapConfig.getObject(String)`, `getString(...)`, `getBoolean(...)`, `getInt(...)`, `getArray(...)` | The typed getters on `CapConfig` for main config values and the `PluginConfig` accessors for plugin config values | | ||
| | `PluginCall.save()` | `setKeepAlive(true)` | | ||
| | `PluginCall.isSaved()` | `isKeptAlive()` | | ||
| | `PluginCall.hasOption(String)` | Typed accessors (`getString(...)`, `getInt(...)`, etc.) | | ||
| | `PluginCall.isReleased()` | No replacement, released calls are managed by the bridge | | ||
| | `Bridge.CAPACITOR_HTTPS_INTERCEPTOR_START` | `CAPACITOR_HTTP_INTERCEPTOR_START`, all proxied requests are handled by it | | ||
| | `Plugin.getConfigValue(String)` | `getConfig()` and the typed accessors on `PluginConfig` | | ||
| | `MessageHandler(Bridge, WebView, Object)` constructor | `MessageHandler(Bridge, WebView)` | | ||
| | `WebViewLocalServer.PathHandler.getResponseHeaders()` | `buildDefaultResponseHeaders()` | |
There was a problem hiding this comment.
This comment applies to this PR and #580.
I wonder if it makes more sense to state these changes in the updating plugins guide, as these APIs would be accessed by plugins, not Capacitor apps, right? It's what we did with #586
Let me know if you agree or think that it's best to leave here, or maybe some other option (leave some in this guide and some in plugins; link from one guide to the next so that information is at least mentioned in both guides?)
There was a problem hiding this comment.
I mostly agree. The Android entries are all plugin-author or embedding APIs, so those fit the plugins guide, consistent with #586. The iOS table has a few app-facing entries though: CAPBridge.handleOpenUrl(_:_:), handleContinueActivity(_:_:) and the status bar notifications were used directly in app code (older deep links docs recommended it).
So I'd go with your cross-link option: move both tables to the plugins guide under "Breaking changes in code" from #586, and keep one sentence in the app guide linking there, noting that apps with custom native code should check that list too.
If that works for you, I'll apply it to both PRs
There was a problem hiding this comment.
Sounds good to me!
…ET-5304-cap9-android-deprecated-apis
Per PR review feedback, the removed APIs are mostly plugin-author facing, so the table now lives in the plugins guide with a pointer from the app guide for apps with custom native code.
Description
Adds the "Breaking changes in @capacitor/android" section to the "Updating to 9.0" upgrade guide (
docs/main/updating/9-0.md) and registers the page in the Upgrade Guides sidebar.The section covers the Java APIs removed in Capacitor 9 (deprecated in previous majors), with a replacement table for each: the legacy
CapConfigconstructor and generic accessors,PluginCall.save()/isSaved()/hasOption()/isReleased(),Bridge.CAPACITOR_HTTPS_INTERCEPTOR_START,Plugin.getConfigValue(String)and the deprecatedMessageHandlerconstructor.Change Type
Rationale / Problems Fixed
Capacitor 9 removes the Android APIs that were deprecated in previous major versions (see ionic-team/capacitor#8553). Plugin authors and app developers hitting compile errors after upgrading need a single place that maps each removed API to its replacement (RMET-5304).
The legacy
@NativePluginecosystem is not covered here because it is intentionally kept in Capacitor 9 for now; its removal is being evaluated separately.Tests or Reproductions
Content was verified against the actual removals in ionic-team/capacitor#8553: every removed symbol listed in the guide matches the source changes, and the replacements were validated by building and running the capacitor-testapp against that branch.
Platforms Affected
Notes / Comments
main, wheredocs/main/updating/9-0.mddoes not exist yet, so it creates the page with the Android section only. docs: add Capacitor 9 upgrade guide with iOS deprecated API removals #580 creates the same page with the iOS section. Whichever merges second needs a trivial rebase to combine both sections into the same file; the sidebar entry is identical in both.